<script setup lang="ts" name="B47ToRawAndMakeRaw">
import { markRaw, reactive, toRaw } from "vue";

const person = reactive({ name: "张三", age: 18 });
const rawPerson = toRaw(person); // 将响应式对象变成普通对象
console.log(person, rawPerson);

const car = markRaw({ brand: "打本", price: 12 }); // 给对象打上标记：永远为普通对象，不能变为响应式对象
const car2 = reactive(car); // 无法变成响应式对象
console.log(car, car2);
</script>

<template>
  <div
    class="border container mx-auto max-w-3xl bg-white my-6 p-6 shadow flex flex-col gap-y-3"
  ></div>
</template>
